package khfx.dao.db;

import java.util.ArrayList;

public class CriteriaSimple implements Criteria {
	String sql = null;
	ArrayList<Criteria> adds = new ArrayList<Criteria>();

	public CriteriaSimple(String _sql) {
		this.sql = _sql;
	}

	public void addCriteria(Criteria c) {
		adds.add(c);
	}

	

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append(" ");
		sb.append(sql);
		for (int i = 0; i < adds.size(); i++) {
			
			Criteria c = adds.get(i);
			sb.append(" and ");
			sb.append(c.toString());
			
		}
		return sb.toString();
	}

}
